<?php
$PeriodList = Dracosys::getSessionValue(SESSION_INTERFACE, 'PeriodList');
$User = Dracosys::getSessionValue(SESSION_INTERFACE, 'User');
?>
<h2>Lançar Pagamento Funcion&aacute;rio</h2>
<section id="ReleasePayment">
    <input type="hidden" name="IDAdministracao" id="ReleasePayment_IDAdministracao" value="<?= treatUrl('id') ?>" />
    <?php
    if (!empty($PeriodList)):
        ?>
        <form method="post" action="administracao/executar-pagamento" name="FormLancarPagamentoFuncionario">
            <?php
            foreach ($PeriodList as $Period):
            ?>
                <div class="toggleContainer" id="ReleasePayment_togglePayment<?= $Period ?>"><a href="#" class="toggle Down" rel="ReleasePayment_Payment<?= $Period ?>">Pagamento correspondente ao periodo <span class="periodo"><?= $Period ?></span></a></div>
                <section id="ReleasePayment_Payment<?= $Period ?>" style="display:none;">
                    <div class="unique grossSalary">Salário Bruto: <span id="ReleasePayment_GrossSalary<?= $Period ?>"><?=MathUtils::money($User->getArDadosAdministracao('FoSalario'))?></span></div>
                    <div class="out_txt big"><label for="ReleasePayment_FoSalarioLiquido<?= $Period ?>">L&iacute;quido</label></div>
                    <div class="inp_txt big"><input type="text" name="FoSalarioLiquido" id="ReleasePayment_FoSalarioLiquido<?= $Period ?>" value="" class="price" /></div>
                    <div class="out_txt big"><label for="ReleasePayment_FoDescontos<?= $Period ?>">Descontos</label></div>
                    <div class="inp_txt big"><input type="text" name="FoDescontos" id="ReleasePayment_FoDescontos<?= $Period ?>" value="" readonly="readonly" class="price" /></div>
                    <div class="out_txt big"><label for="ReleasePayment_FoBonificacoes<?= $Period ?>">Bonifica&ccedil;&otilde;es</label></div>
                    <div class="inp_txt big"><input type="text" name="FoBonificacoes" id="ReleasePayment_FoBonificacoes<?= $Period ?>" value="" class="price" /></div>
                    <div class="out_txt big"><label for="ReleasePayment_DtDiaPagamento<?= $Period ?>">Dia do Pagamento</label></div>
                    <div class="inp_txt big"><input type="text" name="DtDiaPagamento" id="ReleasePayment_DtDiaPagamento<?= $Period ?>" value="" class="date" /></div>
                </section>
            <?php
            endforeach;
            ?>
                <div class="btn"><button class="v1">Confirmar</button></div>
                <input type="hidden" name="IDUsuario" value="<?=treatUrl('id')?>" id="ReleasePayment_IDUsuario" />
        </form>
        <?php
    else:
        ?>
        <div class="no-data">Este funcionário está com pagamento adiantado em 1 m&ecirc;s.</div>
    <?php
    endif;
    ?>
</section>